//
//  ZTXMeRedCell.m
//  NtoccDriverNew
//
//  Created by 张天兴 on 2023/12/7.
//  Copyright © 2023 GCY. All rights reserved.
//

#import "ZTXMeRedCell.h"

@implementation ZTXMeRedCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.contentBgView.layer.masksToBounds = YES;
    self.contentBgView.layer.cornerRadius = 5;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (void)fuzhiZTXMeRedCell:(NSDictionary *)dic{
    self.nameLabel.text = dic[@"driverName"];
    self.timeLabel.text = dic[@"gmtModified"];
    self.cententLabel.text = dic[@"handleIdea"];
}
- (void)fuzhiFanKZTXMeRedCell:(NSDictionary *)dic{
    self.nameLabel.text = dic[@"handler"];
    self.timeLabel.text = dic[@"gmtCreated"];
    self.cententLabel.text = dic[@"handleIdea"];
}
+ (CGFloat)fuzhiDicHeight:(NSDictionary *)dic{
    return [self getWidthWithText:dic[@"handleIdea"] Width:ScreenW - 110 height:0 font:15] + 75;
}
+ (CGFloat)getWidthWithText:(NSString *)text Width:(CGFloat)width height:(CGFloat)height font:(CGFloat)font
{
    //内容宽度自适应
    CGSize size = CGSizeMake(width, height);
    NSDictionary *dic = @{NSFontAttributeName:[UIFont systemFontOfSize:font]};
    CGRect rect = [text boundingRectWithSize:size options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:dic context:nil];
    if (height == 0) {
        return rect.size.height;
    }else {
        return rect.size.width;
    }
}
@end
